/**
 * @Date 2023-02-21 14:24:10
 * @Remark
 */

export const API_ADMIN_ADD: Api = {
  title: "添加管理账户",
  path: "admin/add",
  method: "POST",
  remark: "用户控制器",
};

export interface ReqAddAdmin {
  userName: string;
  fullName: string;
  state: string;
  phone: string;
  password: string;
}

// API -------------------------------------------------------------

export const API_ADMIN_PAGE: Api = {
  title: "管理账户分页",
  path: "admin/list",
  method: "POST",
  remark: "用户控制器",
};

// req
export interface ReqAdminPage extends ReqPage {
}

// API -------------------------------------------------------------

export const API_ADMIN_DETAIL: Api = {
  title: "管理账户详情",
  path: "user/detail",
  method: "POST",
  remark: "用户控制器",
};

// res

// API -------------------------------------------------------------

export const API_ADMIN_UPDATE: Api = {
  title: "编辑管理账户",
  path: "user/update_info_by_id",
  method: "POST",
  remark: "用户控制器",
};

// req
export interface ReqAdminUpdate extends ReqAddAdmin {
  id: string;
}

// res

// API -------------------------------------------------------------

export const API_ADMIN_DEL: Api = {
  title: "删除管理账户",
  path: "admin/delete",
  method: "POST",
  remark: "用户控制器",
};

// req

// res

// API -------------------------------------------------------------

export const API_ADMIN_RESET_PWD: Api = {
  title: "管理账户-重置密码",
  path: "user/reset_pass",
  method: "POST",
  remark: "用户控制器",
};

export interface ReqResetPwd {
  userId: number;
  pass: string;
}

// API -------------------------------------------------------------

export const API_ADMIN_CHANGE_STATE: Api = {
  title: "管理账户-用户状态",
  path: "user/update_state",
  method: "POST",
  remark: "用户控制器",
};

export interface ReqEditAdminState {
  userId: number;
  state: number;
}

// API -------------------------------------------------------------

export const API_ADMIN_EDIT_ROLE: Api = {
  title: "管理账户-用户角色",
  path: "role/setRoleUser",
  method: "POST",
  remark: "用户控制器",
};

export interface ReqEditAdminRole {
  userId: number;
  roleIds: string[];
}

// API -------------------------------------------------------------

export const API_ADMIN_ROLE_LIST: Api = {
  title: "管理账户-用户角色",
  path: "user/role_list",
  method: "POST",
  remark: "用户控制器",
};

export interface ReqGetAdminRole {
  userId: number;
}
